#ifndef INFINITY_PLANET_SHAPE_H
#	define INFINITY_PLANET_SHAPE_H

#include "libnoise/noise.h"

namespace infinity {

class PlanetShape
:	public noise::module::Module
{
public :
    PlanetShape()
	:	noise::module::Module(GetSourceModuleCount())
	{
	}

    virtual int GetSourceModuleCount () const
    {
      return 2;
    }

    virtual double GetValue (double x, double y, double z) const
	{
		dwAssert(m_pSourceModule[0] != NULL, "Invalid source module");
		dwAssert(m_pSourceModule[1] != NULL, "Invalid source module");

		double max = m_pSourceModule[0]->GetValue(x, 0, z);
		double min = m_pSourceModule[1]->GetValue(x, 0, z);
		double val = 0.0f;

		if (y >= min && y <= max)
			val = 1.0f;

		return val;
	}

private : //! @name Data
	//! @{
	double m_offset;
	double m_scale;
	double m_sourceY;
	//! @}
};

} // namespace infinity

#endif // !INFINITY_PLANET_SHAPE_H
